package com.maple.model

/**
  * author: HuaZhe Ray
  *
  * describe: TODO
  *
  * createDate: 2017/12/7
  * createTime: 17:33
  *
  */
class Classes (val name:String/*, students: List[Student] = Nil*/) {

//  val students1:List[Student] = JdbcRepo.queryStudentsByClass(this)
    var students:List[Student] = Nil
    def getStudents = JdbcRepo.queryStudentsByClass(this)

    def this(name:String,students: List[Student]) {
        this(name)
        this.students = getStudents
    }
}

object Classes{

  def apply(name: String ): Classes = new Classes(name)
  def apply(name: String ,students: List[Student] ): Classes = new Classes(name,students)
}
